package com.inno.subject.infra.basic.service.impl;

import com.inno.subject.infra.basic.entity.PlannerSubjectType;
import com.inno.subject.infra.basic.mapper.PlannerSubjectTypeDao;
import com.inno.subject.infra.basic.service.PlannerSubjectTypeService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * (PlannerSubjectType)表服务实现类
 *
 * @author makejava
 * @since 2024-11-16 20:57:06
 */
@Service
public class PlannerSubjectTypeServiceImpl implements PlannerSubjectTypeService {
    @Resource
    private PlannerSubjectTypeDao plannerSubjectTypeDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public PlannerSubjectType queryById(Long id) {
        return this.plannerSubjectTypeDao.queryById(id);
    }



    /**
     * 新增数据
     *
     * @param plannerSubjectType 实例对象
     * @return 实例对象
     */
    @Override
    public PlannerSubjectType insert(PlannerSubjectType plannerSubjectType) {
        this.plannerSubjectTypeDao.insert(plannerSubjectType);
        return plannerSubjectType;
    }

    /**
     * 修改数据
     *
     * @param plannerSubjectType 实例对象
     * @return 实例对象
     */
    @Override
    public PlannerSubjectType update(PlannerSubjectType plannerSubjectType) {
        this.plannerSubjectTypeDao.update(plannerSubjectType);
        return this.queryById(plannerSubjectType.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.plannerSubjectTypeDao.deleteById(id) > 0;
    }

    @Override
    public List<PlannerSubjectType> queryByIdList(List<Long> typeIdList) {
        return this.plannerSubjectTypeDao.queryByIdList(typeIdList);
    }

    @Override
    public List<PlannerSubjectType> queryList() {
        return this.plannerSubjectTypeDao.queryList();
    }
}
